package freshmanspecial.mredrock.com.welcomefreshman.Fragment;

import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;

import freshmanspecial.mredrock.com.welcomefreshman.Adapter.MienRecyclerAdapter;
import freshmanspecial.mredrock.com.welcomefreshman.Base.BaseFragment;
import freshmanspecial.mredrock.com.welcomefreshman.Bean.BeautyInCQUPTBean;
import freshmanspecial.mredrock.com.welcomefreshman.Model.MienModel;
import freshmanspecial.mredrock.com.welcomefreshman.R;

/**
 * Created by Administrator on 2017/8/6 0006.
 */

public class MienBeaFragment extends BaseFragment {
    private MienRecyclerAdapter adapter;
    private BeautyInCQUPTBean bean;
    private RecyclerView recyclerView;
    @Override
    protected void addDefaultData() {
        MienModel mienModel = new MienModel();
        mienModel.getBeauty(new MienModel.OnGetMien() {
            @Override
            public void onFinish(Object dataBean) {
                bean = (BeautyInCQUPTBean) dataBean;
                adapter = new MienRecyclerAdapter(bean,getActivity(),1,null);
                recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
                recyclerView.setAdapter(adapter);
            }
        });
    }
    @Override
    protected void initView() {
        recyclerView  = $(R.id.beauty_rv);

    }

    @Override
    protected int getResourceId() {
        return R.layout.special_2017_mien_beauty_fragment;
    }
}
